<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        
        <style type ="text/css">
        @import url(member/css/jqtransform.css);
        @import url(member/css/validationEngine.jquery.css);
        @import url(member/css/ui-lightness/jquery-ui-1.8.19.custom.css);
        </style>
        <script type="text/javascript" src="member/js/jquery-latest.js"></script>
        <script type="text/javascript" src="member/js/jquery-ui-1.8.19.custom.min.js"></script>
        <script type="text/javascript" src="member/js/jquery"></script>
        <script type="text/javascript" src="member/js/jquery.jqtransform.js"></script>
        
        <script type="text/javascript" src="member/js/jquery.validationEngine-en.js"></script>
        <script type="text/javascript" src="member/js/jquery.validationEngine.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                
                
                //find all form with class jqtransform and apply the plugin
                $("form.jqtransform").jqTransform();
                
                $('#bday').datepicker({ dateFormat: 'yy-mm-dd' });
                $('#add_form').validationEngine('attach');
                $('#cancelForm').click(function(){
                    $('#panel').html(''); 
                });

            });
        </script>
    </head>
    <body>
        <div id ="edit_head" style =" font-size: 22px; text-align: center; color:#525252;">Edit Member</div> </br>   
    <form id="add_form" class="jqtransform" method="post" action="${pageContext.request.contextPath}/member_edit">
    <table style="width: 50%">
        <input type="hidden" name="memberid" type="text" <c:if test="${!empty memItem}"> value="${memItem.memberid}"</c:if>/>
		<tr>
			<td><label> Password </label></td>
                        <td><input class="validate[required,minSize[8] text-input" id="password" name="password" type="password" <c:if test="${!empty memItem}"> value="${memItem.password}" </c:if> /> </td>
		</tr>
                
                <tr>
			<td><label> Repass </label></td>
			<td><input class="validate[required,equals[password]] text-input" id="repassword" name="repassword" type="password" <c:if test="${!empty memItem}"> value="${memItem.password}" </c:if> /> </td>
		</tr>
               
                <tr>
			<td><label> Nickname </label></td>
			<td><input class="validate[required,custom[onlyLetterSp]]" id="nickname" name="nickname" type="text" <c:if test="${!empty memItem}"> value="${memItem.nickname}" </c:if>  /></td>
		</tr>
                <tr>
			<td><label> Birthdate </label></td>
			<td><input class="validate[required,custom[date]] text-input"  id="bday" name="bday" type="text" <c:if test="${!empty memItem}"> value="${memItem.birthdate}" </c:if>  /></td>
		</tr>
                <tr>
			<td><label> Course </label></td>
			<td><input class="validate[required]" id="course" name="course" type="text" <c:if test="${!empty memItem}"> value="${memItem.course}" </c:if>  /></td>
		</tr>
                <tr>
			<td><label> Phone </label></td>
			<td><input class="validate[required,custom[integer]]" id="pnumber" name="pnumber" type="text" <c:if test="${!empty memItem}"> value="${memItem.phone_number}" </c:if>  /></td>
		</tr>
                <tr>
			<td><label> Cellphone </label></td>
			<td><input class="validate[required,custom[integer]]" id="cnumber" name="cnumber" type="text" <c:if test="${!empty memItem}"> value="${memItem.cell_number}" </c:if>  /></td>
		</tr>
                <tr>
			<td><label> Email </label></td>
			<td><input class="validate[required,custom[email]] text-input" id="email" name="email" type="text" <c:if test="${!empty memItem}"> value="${memItem.email}" </c:if>  /></td>
		</tr>
    </table>
    <input type="submit" id ="editMember" name="editMember" value="Submit"/>
    </form>
    </body>
</html>